package com.example.qxfw.qxxx.mapper;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.qxfw.common.entity.qx.MsgRainMinute;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
@DS("qx")
public interface MsgRainMinuteMapper extends BaseMapper<MsgRainMinute> {

    @Select("select station_id_c, station_name, to_char(dateTime, 'yyyy-MM-dd HH24:MI:00') as datetime, lon, lat, ${dbName} as ${sort}, cnty " +
            "from msg_rain_minute " +
            "where datetime='${dateTime}' and ${dbName} != -65535  ${sql} " +
            "order by ${sort} ")
    List<MsgRainMinute> selectList(String dbName,String sort,String dateTime,String sql);

    @Select("select station_id_c, station_name, lon, lat, datetime, wind_s_avg_1mi, wind_d_avg_1mi, cnty " +
            "from msg_rain_minute " +
            "where datetime='${dateTime}' and ${dbName} != -65535  ${sql} " +
            "order by wind_s_avg_1mi")
    List<MsgRainMinute> selectList1(String dateTime,String dbName,String sql);

    @Select("select station_id_c, station_name, lon, lat, ${selElement}, cnty " +
            "from msg_rain_minute " +
            "where (datetime between '${startTime}' and '${endTime}')  and ${dbName}!='-65535' ${sql} ")
    List<MsgRainMinute> selectList2(String selElement,String startTime,String endTime,String dbName,String sql);

}
